#include <iostream>

#include "metrics/Counter.hpp"
#include "metrics/Builder.hpp"
#include "metrics/JsonMetricFormatter.hpp"

int main(int argc, char const *argv[])
{
    auto registry = std::make_shared<metrics::MetricRegistry>();

    std::map<std::string, std::string> m{{"a", "b"}, {"c", "d"}};

    std::shared_ptr<metrics::Family<metrics::Counter>> counterFamily = metrics::BuildCounter().name("count_total").help("test").labels(m).metric_register(registry);
    std::shared_ptr<metrics::Counter> inputCount = counterFamily->add({{"direct","input"}});
    std::shared_ptr<metrics::Counter> outputCount = counterFamily->add({{"direct","output"}});

    inputCount->increment(33);
    outputCount->increment(100);

    auto metrics = registry->collect();

    metrics::JsonMetricFormatter jmf;
    for (auto &metric : metrics)
    {
        auto strs = jmf.format(metric);
        std::cout << strs[0] << std::endl;
    }

    return 0;
}